package stack

import (
	"gvm/instructions/base"
	"gvm/rtda"
)

type POP struct {
	base.NoOperandsInstruction
}

func (self *POP) Execute(jFrame *rtda.JFrame) {
	stack := jFrame.OperandStack()
	stack.PopRef()
}

// POP2 Pop the top one or two operand stack values
type POP2 struct{ base.NoOperandsInstruction }

/*
bottom -> top
[...][c][b][a]
         |  |
         V  V
[...][c]
*/

func (p *POP2) Execute(jFrame *rtda.JFrame) {
	stack := jFrame.OperandStack()
	stack.PopSlot()
	stack.PopSlot()
}
